package com.jisuan.contract.controller;

import com.jisuan.contract.common.utils.R;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/contract/user")
@CrossOrigin  //解决跨域
public class ContractLoginController {

    //login
    @PostMapping("login")
    public R login() {
      return R.ok().put("token","admin");
    }
    //info
    @GetMapping("info")
    public R info() {
      return R.ok().put("roles","[admin]").put("name","admin").put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }

  //logout
  @PostMapping("logout")
  public R logout() {
    return R.ok();
  }
}

